/** @jsxImportSource @emotion/react */
import * as React from "react";
import {
    Text, InputLine, SuffixInput, LineColumn, Input, CCell, Table, TableBody, TableRow, TableHead, BlobInputList,
} from "customize-easy-ui-component";
import {InspectRecordLayout, InternalItemProps, SelectHookfork, useItemInputControl,} from "../../common/base";
import {useMeasureInpFilter} from "../../common/hooks";
import {objNestSet, tableSetInp} from "../../../common/tool";
import {RepLink} from "../../common/base";

const 运行行程its=['(1)小车','(2)大车'];
const 支腿垂its=['前支腿1','前支腿2','中支腿1','中支腿2'];
const 重量表its=['1次','2次','3次(额载)'];
const 幅度its=['1次(R0.3)','2次(R0.6)','3次(R0.9)','平均值'];
const 力矩its=['1次','2次','3次','平均值'];
interface Props  extends InternalItemProps{
    label?: string;
}
const 结果选=['√','——','×'];
const items观测 = [['起高表','12.9.3起升高度（下降深度）（m)'],['行程表','12.9.4运行行程(m)'],['风速o','12.9.5风速(m/s)'],
    ['回转o','12.9.6回转角度(°)'],['支腿表','12.9.12支腿垂直度(mm/m)'],['重量表',<>12.11.1起重量综合误差试验E<sub>Q</sub></>],
    ['幅空表',<>12.11.2幅度综合误差试验（空载）E<sub>R</sub></>],['幅额表',<>12.11.2幅度综合误差试验（流动式起重机额载）E<sub>R</sub></>],
    ['力矩表',<>12.11.3起重力矩综合误差试验E<sub>M</sub></>]
] as any[];
export const itemA安监控管 = [ ] as string[];
items观测.forEach(([name,title], i:number)=>{
    itemA安监控管.push(name+'',  name+'r');
});
export const MonitoringSmms =
    React.forwardRef((
        {children, show, alone = true, refWidth,label,}: Props, ref
    ) => {
        const [getInpFilter] = useMeasureInpFilter(null, itemA安监控管,);
        const {inp, setInp} = useItemInputControl({ ref });
        return (
            <InspectRecordLayout inp={inp} setInp={setInp} getInpFilter={getInpFilter} show={show}
                                 alone={alone} label={label!}>
                <Text variant="h5">{label}</Text>
                <Text variant="h5" css={{fontSize:'1.3rem'}}>项目1: {items观测[0][1]}{'>>'}</Text>
                <div css={{display: 'flex', margin: 'auto'}}>
                    <div css={{display: 'inline-block', margin: 'auto'}}>
                        {(new Array(1)).fill(null).map((group, g: number) => {
                            const tabn=items观测[0][0] as string;
                            return <React.Fragment key={g}>
                            {['1次','2次','3次'].map((group, i: number) => {
                                let d=g*3+i;
                                return <React.Fragment key={d}>
                                    <Text variant="h5">&nbsp; {group} :</Text>
                                    显示屏数值H1
                                    <Input value={inp?.[tabn]?.[d]?.H1 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,d, inp,setInp,'H1',e.currentTarget.value||undefined)}/>
                                    (m)，H2
                                    <Input value={inp?.[tabn]?.[d]?.H2 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,d, inp,setInp,'H2',e.currentTarget.value||undefined)}/>
                                    (m)，测量值h1
                                    <Input value={inp?.[tabn]?.[d]?.h1 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,d, inp,setInp,'h1',e.currentTarget.value||undefined)}/>
                                    (m)，h2
                                    <Input value={inp?.[tabn]?.[d]?.h2 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,d, inp,setInp,'h2',e.currentTarget.value||undefined)}/>
                                    (m)，计算值H
                                    <Input value={inp?.[tabn]?.[d]?.H ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,d, inp,setInp,'H',e.currentTarget.value||undefined)}/>
                                    (m)，h
                                    <Input value={inp?.[tabn]?.[d]?.h ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,d, inp,setInp,'h',e.currentTarget.value||undefined)}/>
                                    (m)&nbsp;检验结果：
                                    <BlobInputList value={inp?.[tabn]?.[d]?.R ||''} datalist={结果选} style={{display: 'inline-table', width: '7rem'}}  rows={1}
                                          onListChange={v => tableSetInp(tabn,d, inp,setInp,'R',v||undefined) }/>
                                </React.Fragment>;
                            })}
                            </React.Fragment>;
                        })}
                        <br/><Text variant="h5" css={{display:'inline-flex'}}>{items观测[0][1]}-结论：</Text>
                        <div css={{width: '12rem', display: 'inline-flex', "& > div": {width: '100%'}}}>
                            <SelectHookfork value={(inp?.[items观测[0][0]+'r']) || ''}
                                            onChange={e => setInp({...inp, [items观测[0][0]+'r']: e.currentTarget.value || undefined})}/>
                        </div>
                    </div>
                </div>
                <Text variant="h5" css={{fontSize:'1.3rem',marginTop:'1rem'}}>项目2: {items观测[1][1]}{'>>'}</Text>
                <div css={{display: 'flex', margin: 'auto'}}>
                    <div css={{display: 'inline-block', margin: 'auto'}}>
                        {运行行程its.map((group, i: number) => {
                            const tabn=items观测[1][0] as string;
                            return <React.Fragment key={i}>
                                <Text variant="h6">{group}:</Text>
                                显示屏数值S0
                                <Input value={inp?.[tabn]?.[i]?.S0 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'S0',e.currentTarget.value||undefined)}/>
                                (m)，S1
                                <Input value={inp?.[tabn]?.[i]?.S1 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'S1',e.currentTarget.value||undefined)}/>
                                (m)，测量值s0
                                <Input value={inp?.[tabn]?.[i]?.s0 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'s0',e.currentTarget.value||undefined)}/>
                                (m)，s1
                                <Input value={inp?.[tabn]?.[i]?.s1 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'s1',e.currentTarget.value||undefined)}/>
                                (m)，计算值S
                                <Input value={inp?.[tabn]?.[i]?.S ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'S',e.currentTarget.value||undefined)}/>
                                (m)，s
                                <Input value={inp?.[tabn]?.[i]?.s ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'s',e.currentTarget.value||undefined)}/>
                                (m)&nbsp;检验结果：
                                <BlobInputList value={inp?.[tabn]?.[i]?.R ||''} datalist={结果选} style={{display: 'inline-table', width: '7rem'}}  rows={1}
                                               onListChange={v => tableSetInp(tabn,i, inp,setInp,'R',v||undefined) }/>
                            </React.Fragment>;
                        })}
                        <br/><Text variant="h5" css={{display:'inline-flex'}}>{items观测[1][1]}-结论：</Text>
                        <div css={{width: '12rem', display: 'inline-flex', "& > div": {width: '100%'}}}>
                            <SelectHookfork value={(inp?.[items观测[1][0]+'r']) || ''}
                                            onChange={e => setInp({...inp, [items观测[1][0]+'r']: e.currentTarget.value || undefined})}/>
                        </div>
                    </div>
                </div>
                <hr/>
                {(new Array(2)).fill(null).map((_, r: number) => {
                    const k=2+r;
                    const tabn=items观测[k][0];
                    return <React.Fragment key={k}>
                        <Text variant="h5" css={{fontSize:'1.3rem',marginTop:'1rem'}}>项目{k+1}: {items观测[k][1]} {'>>'}</Text>
                        <LineColumn column={6}>
                            <InputLine label={`显示屏数值：`}>
                                <SuffixInput  value={inp?.[tabn]?.S0 ||''}
                                              onChange={e=>objNestSet(tabn,'S0',e.currentTarget.value||undefined, inp, setInp)}>{1===r? '°':'m/s'}</SuffixInput>
                            </InputLine>
                            <InputLine label={`测量值：`}>
                                <SuffixInput  value={inp?.[tabn]?.s0 ||''}
                                              onChange={e=>objNestSet(tabn,'s0',e.currentTarget.value||undefined, inp, setInp)}>{1===r? '°':'m/s'}</SuffixInput>
                            </InputLine>
                            <InputLine label={items观测[k][1]+`-检验结果：`}>
                                <BlobInputList value={inp?.[tabn]?.R ||''} datalist={结果选} style={{display: 'inline-table', width: '7rem'}}  rows={1}
                                               onListChange={v => objNestSet(tabn,'R',v||undefined, inp, setInp) }/>
                            </InputLine>
                            <InputLine label='结论'>
                                <SelectHookfork value={(inp?.[tabn+'r']) || ''}
                                                onChange={e => setInp({...inp, [tabn+'r']: e.currentTarget.value || undefined})}/>
                            </InputLine>
                        </LineColumn>
                    </React.Fragment>;
                })}
                <Text variant="h5" css={{fontSize:'1.3rem',marginTop:'1rem'}}>项目5: {items观测[4][1]}{'>>'}</Text>
                <div css={{display: 'flex', margin: 'auto'}}>
                    <div css={{display: 'inline-block', margin: 'auto'}}>
                        {支腿垂its.map((group, i: number) => {
                            const tabn=items观测[4][0];
                            return <React.Fragment key={i}>
                                <Text variant="h6">{group}:</Text>
                                显示屏数值S0
                                <Input value={inp?.[tabn]?.[i]?.S0 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'S0',e.currentTarget.value||undefined)}/>
                                (mm/m)，测量值s0
                                <Input value={inp?.[tabn]?.[i]?.s0 ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'s0',e.currentTarget.value||undefined)}/>
                                (mm/m)&nbsp;检验结果：
                                <BlobInputList value={inp?.[tabn]?.[i]?.R ||''} datalist={结果选} style={{display: 'inline-table', width: '7rem'}}  rows={1}
                                               onListChange={v => tableSetInp(tabn,i, inp,setInp,'R',v||undefined) }/>
                            </React.Fragment>;
                        })}
                        <br/><Text variant="h5" css={{display:'inline-flex'}}>{items观测[4][1]}-结论：</Text>
                        <div css={{width: '12rem', display: 'inline-flex', "& > div": {width: '100%'}}}>
                            <SelectHookfork value={(inp?.[items观测[4][0]+'r']) || ''}
                                            onChange={e => setInp({...inp, [items观测[4][0]+'r']: e.currentTarget.value || undefined})}/>
                        </div>
                    </div>
                </div>
                <Text variant="h5" css={{fontSize:'1.3rem',marginTop:'1rem'}}>项目6: {items观测[5][1]}{'>>'}</Text>
                <div css={{display: 'flex', margin: 'auto'}}>
                    <div css={{display: 'inline-block', margin: 'auto'}}>
                        {重量表its.map((group, i: number) => {
                            const tabn=items观测[5][0];
                            return <React.Fragment key={i}>
                                <Text variant="h6">{group}:</Text>
                                显示屏数值Qa
                                <Input value={inp?.[tabn]?.[i]?.Qa ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Qa',e.currentTarget.value||undefined)}/>
                                (t)，测量值Qb
                                <Input value={inp?.[tabn]?.[i]?.Qb ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Qb',e.currentTarget.value||undefined)}/>
                                (t)，计算值EQ
                                <Input value={inp?.[tabn]?.[i]?.Eq ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Eq',e.currentTarget.value||undefined)}/>
                                (t)&nbsp;检验结果：
                                <BlobInputList value={inp?.[tabn]?.[i]?.R ||''} datalist={结果选} style={{display: 'inline-table', width: '7rem'}}  rows={1}
                                               onListChange={v => tableSetInp(tabn,i, inp,setInp,'R',v||undefined) }/>
                            </React.Fragment>;
                        })}
                        <br/><Text variant="h5" css={{display:'inline'}}>{items观测[5][1]}-结论：</Text>
                        <div css={{width: '12rem', display: 'inline-flex', "& > div": {width: '100%'}}}>
                            <SelectHookfork value={(inp?.[items观测[5][0]+'r']) || ''}
                                            onChange={e => setInp({...inp, [items观测[5][0]+'r']: e.currentTarget.value || undefined})}/>
                        </div>
                    </div>
                </div>
                <Text variant="h5" css={{fontSize:'1.3rem',marginTop:'1rem'}}>项目7: {items观测[6][1]}{'>>'}</Text>
                <div css={{display: 'flex', margin: 'auto'}}>
                    <div css={{display: 'inline-block', margin: 'auto'}}>
                        {幅度its.map((group, i: number) => {
                            const tabn=items观测[6][0];
                            return <React.Fragment key={i}>
                                <Text variant="h6">{group}:</Text>
                                显示屏数值Rb
                                <Input value={inp?.[tabn]?.[i]?.Rb ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Rb',e.currentTarget.value||undefined)}/>
                                (m)，测量值Ra
                                <Input value={inp?.[tabn]?.[i]?.Ra ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Ra',e.currentTarget.value||undefined)}/>
                                (m)
                                {3===i && <>
                                    ，计算值ER
                                    <Input value={inp?.[tabn]?.[i]?.Er ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,i, inp,setInp,'Er',e.currentTarget.value||undefined)}/>
                                    (m)
                                </>}
                            </React.Fragment>;
                        })}
                        <br/><Text variant="h5" css={{display:'inline'}}>{items观测[6][1]}-结论：</Text>
                        <div css={{width: '12rem', display: 'inline-flex', "& > div": {width: '100%'}}}>
                            <SelectHookfork value={(inp?.[items观测[6][0]+'r']) || ''}
                                            onChange={e => setInp({...inp, [items观测[6][0]+'r']: e.currentTarget.value || undefined})}/>
                        </div>
                    </div>
                </div>
                <Text variant="h5" css={{fontSize:'1.3rem',marginTop:'1rem'}}>项目8: {items观测[7][1]}{'>>'}</Text>
                <div css={{display: 'flex', margin: 'auto'}}>
                    <div css={{display: 'inline-block', margin: 'auto'}}>
                        {幅度its.map((group, i: number) => {
                            const tabn=items观测[7][0];
                            return <React.Fragment key={i}>
                                <Text variant="h6">{group}:</Text>
                                显示屏数值Rb
                                <Input value={inp?.[tabn]?.[i]?.Rb ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Rb',e.currentTarget.value||undefined)}/>
                                (m)，测量值Ra
                                <Input value={inp?.[tabn]?.[i]?.Ra ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Ra',e.currentTarget.value||undefined)}/>
                                (m)，计算值ER
                                <Input value={inp?.[tabn]?.[i]?.Er ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Er',e.currentTarget.value||undefined)}/>
                                (m)
                            </React.Fragment>;
                        })}
                        <br/><Text variant="h5" css={{display:'inline'}}>{items观测[7][1]}-结论：</Text>
                        <div css={{width: '12rem', display: 'inline-flex', "& > div": {width: '100%'}}}>
                            <SelectHookfork value={(inp?.[items观测[7][0]+'r']) || ''}
                                            onChange={e => setInp({...inp, [items观测[7][0]+'r']: e.currentTarget.value || undefined})}/>
                        </div>
                    </div>
                </div>
                <Text variant="h5" css={{fontSize:'1.3rem',marginTop:'1rem'}}>项目9: {items观测[8][1]}{'>>'}</Text>
                <div css={{display: 'flex', margin: 'auto'}}>
                    <div css={{display: 'inline-block', margin: 'auto'}}>
                        {力矩its.map((group, i: number) => {
                            const tabn=items观测[8][0];
                            return <React.Fragment key={i}>
                                <Text variant="h6">{group}:</Text>
                                {3!==i && <>
                                    显示屏数值Mb
                                    <Input value={inp?.[tabn]?.[i]?.Mb ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,i, inp,setInp,'Mb',e.currentTarget.value||undefined)}/>
                                    (tm)，测量值Ma
                                    <Input value={inp?.[tabn]?.[i]?.Ma ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                           onChange={e =>tableSetInp(tabn,i, inp,setInp,'Ma',e.currentTarget.value||undefined)}/>
                                    (tm)，
                                </>}
                                计算值EM
                                <Input value={inp?.[tabn]?.[i]?.Em ||''} size={4} style={{display: 'inline-flex', width: 'unset'}}
                                       onChange={e =>tableSetInp(tabn,i, inp,setInp,'Em',e.currentTarget.value||undefined)}/>
                                (tm)
                                {3===i && <>
                                    &nbsp;检验结果：
                                    <BlobInputList value={inp?.[tabn]?.[i]?.R ||''} datalist={结果选} style={{display: 'inline-table', width: '7rem'}}  rows={1}
                                                   onListChange={v => tableSetInp(tabn,i, inp,setInp,'R',v||undefined) }/>
                                </>}
                            </React.Fragment>;
                        })}
                        <br/><Text variant="h5" css={{display:'inline'}}>{items观测[8][1]}-结论：</Text>
                        <div css={{width: '12rem', display: 'inline-flex', "& > div": {width: '100%'}}}>
                            <SelectHookfork value={(inp?.[items观测[8][0]+'r']) || ''}
                                            onChange={e => setInp({...inp, [items观测[8][0]+'r']: e.currentTarget.value || undefined})}/>
                        </div>
                    </div>
                </div>
                {children}
            </InspectRecordLayout>
        );
} );

const yxcSpan=运行行程its.length+1;
const zhonSpan=重量表its.length+1;
const tuiSpan=支腿垂its.length;
const fuduSpan=幅度its.length+1;
const lijuSpan=力矩its.length+1;
//桥门 的版本：
export const MonitoringSmmsVw= ({children, orc, rep,label } : { orc: any, rep: any,label:any, children?: any}
) => {
    return <>
        <div css={{"@media print": {paddingBottom: '8rem', pageBreakInside: 'avoid'}}}>
            <Text variant="h4" css={{marginTop: '1rem',}}>{label}</Text>
        </div>
        <Table id={'Monitoring'} fixed={ ["3.5%", "%", "11%", "10%", "9%", "9%", "9%", "9%", "9%", "8%", "6%"] }
                    css={{borderCollapse: 'collapse',"@media print": {marginTop: '-8rem'}}} tight miniw={800}>
            <TableHead>
                <TableRow>
                    <CCell>序号</CCell>
                    <CCell>项目编号</CCell>
                    <CCell>次数(类别)</CCell>
                    <CCell colSpan={2}>显示屏数值</CCell>
                    <CCell colSpan={2}>测量值(标定值)</CCell>
                    <CCell colSpan={2}>计算值</CCell>
                    <CCell>检验结果</CCell><CCell>结论</CCell>
                </TableRow>
            </TableHead>
            <TableBody>
                <RepLink ori rep={rep} tag={'Monitoring'}>
                    <TableRow>
                        <CCell rowSpan={4}>1</CCell>
                        <CCell rowSpan={4}>{items观测[0][1]}</CCell>
                        <CCell>/</CCell>
                        <CCell>H1</CCell>
                        <CCell>H2</CCell>
                        <CCell>h1</CCell>
                        <CCell>h2</CCell>
                        <CCell>H</CCell>
                        <CCell>h</CCell><CCell>/</CCell>
                        <CCell rowSpan={4}>{orc?.[items观测[0][0]+'r']}</CCell>
                    </TableRow>
                    {(new Array(3)).fill(null).map((_, r: number) => {
                        const tabn=items观测[0][0] as string;
                        const o = orc?.[tabn]?.[r];
                        return <TableRow key={r}>
                            <CCell>{r + 1}次</CCell>
                            <CCell>{o?.H1}</CCell>
                            <CCell>{o?.H2}</CCell>
                            <CCell>{o?.h1}</CCell>
                            <CCell>{o?.h2}</CCell>
                            <CCell>{o?.H}</CCell>
                            <CCell>{o?.h}</CCell><CCell>{o?.R}</CCell>
                        </TableRow>;
                    })}
                    <TableRow>
                        <CCell rowSpan={yxcSpan}>2</CCell>
                        <CCell rowSpan={yxcSpan}>{items观测[1][1]}</CCell>
                        <CCell>/</CCell>
                        <CCell>S0</CCell>
                        <CCell>S1</CCell>
                        <CCell>s0</CCell>
                        <CCell>s1</CCell>
                        <CCell>S</CCell>
                        <CCell>s</CCell><CCell>/</CCell>
                        <CCell rowSpan={yxcSpan}>{orc?.[items观测[1][0]+'r']}</CCell>
                    </TableRow>
                    {运行行程its.map((group, r: number) => {
                        const o = orc.行程表?.[r];
                        return <TableRow key={r}>
                            <CCell>{group}</CCell>
                            <CCell>{o?.S0}</CCell>
                            <CCell>{o?.S1}</CCell>
                            <CCell>{o?.s0}</CCell>
                            <CCell>{o?.s1}</CCell>
                            <CCell>{o?.S}</CCell>
                            <CCell>{o?.s}</CCell>
                            <CCell>{o?.R}</CCell>
                        </TableRow>;
                    })}
                    {(new Array(2)).fill(null).map((_, r: number) => {
                        const k=2+r;
                        const tabn=items观测[k][0];
                        const o = orc?.[tabn]?.[r];
                        return <TableRow key={k}>
                                <CCell>{k+1}</CCell>
                                <CCell>{items观测[k][1]}</CCell>
                                <CCell>/</CCell>
                                <CCell>{orc?.[items观测[k][0]]?.S0}</CCell><CCell>/</CCell>
                                <CCell>{orc?.[items观测[k][0]]?.s0}</CCell><CCell>/</CCell><CCell>/</CCell><CCell>/</CCell>
                                <CCell>{orc?.[items观测[k][0]]?.R}</CCell>
                                <CCell>{orc?.[items观测[k][0]+'r']}</CCell>
                            </TableRow>;
                    })}
                    {支腿垂its.map((rowl, r: number) => {
                        const tabn=items观测[4][0] as string;
                        const o = orc?.[tabn]?.[r];
                        return <TableRow key={r}>
                            { 0===r && <>
                                <CCell rowSpan={tuiSpan}>5</CCell>
                                <CCell rowSpan={tuiSpan}>{items观测[4][1]}</CCell>
                            </>}
                            <CCell>{rowl}</CCell>
                            <CCell>{o?.S0}</CCell><CCell>/</CCell>
                            <CCell>{o?.s0}</CCell><CCell>/</CCell><CCell>/</CCell><CCell>/</CCell>
                            <CCell>{o?.R}</CCell>
                            {0===r && <CCell rowSpan={tuiSpan}>{orc?.[items观测[4][0]+'r']}</CCell>}
                        </TableRow>;
                    })}
                    <TableRow>
                        <CCell rowSpan={zhonSpan}>6</CCell>
                        <CCell rowSpan={zhonSpan}>{items观测[5][1]}</CCell>
                        <CCell>(单位为t)</CCell>
                        <CCell>Qa</CCell><CCell>/</CCell>
                        <CCell>Qb</CCell><CCell>/</CCell>
                        <CCell>E<sub>Q</sub></CCell><CCell>/</CCell><CCell>/</CCell>
                        <CCell rowSpan={zhonSpan}>{orc?.[items观测[5][0]+'r']}</CCell>
                    </TableRow>
                    {重量表its.map((rowl, r: number) => {
                        const tabn=items观测[5][0];
                        const o = orc?.[tabn]?.[r];
                        return <TableRow key={r}>
                            <CCell>{rowl}</CCell>
                            <CCell>{o?.Qa}</CCell><CCell>/</CCell>
                            <CCell>{o?.Qb}</CCell><CCell>/</CCell>
                            <CCell>{o?.Eq}</CCell><CCell>/</CCell>
                            <CCell>{o?.R}</CCell>
                        </TableRow>;
                    })}
                    <TableRow>
                        <CCell rowSpan={fuduSpan}>7</CCell>
                        <CCell rowSpan={fuduSpan}>{items观测[6][1]}</CCell>
                        <CCell>(单位为m)</CCell>
                        <CCell>Rb</CCell><CCell>/</CCell>
                        <CCell>Ra</CCell><CCell>/</CCell>
                        <CCell>E<sub>R</sub></CCell><CCell>/</CCell><CCell>/</CCell>
                        <CCell rowSpan={fuduSpan}>{orc?.[items观测[6][0]+'r']}</CCell>
                    </TableRow>
                    {幅度its.map((rowl, r: number) => {
                        const tabn=items观测[6][0];
                        const o = orc?.[tabn]?.[r];
                        return <TableRow key={r}>
                            <CCell>{rowl}</CCell>
                            <CCell>{o?.Rb}</CCell><CCell>/</CCell>
                            <CCell>{o?.Ra}</CCell><CCell>/</CCell>
                            <CCell>{3===r? o?.Er : '/'}</CCell>
                            <CCell>/</CCell><CCell>/</CCell>
                        </TableRow>;
                    })}
                    <TableRow>
                        <CCell rowSpan={fuduSpan}>8</CCell>
                        <CCell rowSpan={fuduSpan}>{items观测[7][1]}</CCell>
                        <CCell>(单位为m)</CCell>
                        <CCell>Rb</CCell><CCell>/</CCell>
                        <CCell>Ra</CCell><CCell>/</CCell>
                        <CCell>E<sub>R</sub></CCell><CCell>/</CCell><CCell>/</CCell>
                        <CCell rowSpan={fuduSpan}>{orc?.[items观测[7][0]+'r']}</CCell>
                    </TableRow>
                    {幅度its.map((rowl, r: number) => {
                        const tabn=items观测[7][0];
                        const o = orc?.[tabn]?.[r];
                        return <TableRow key={r}>
                            <CCell>{rowl}</CCell>
                            <CCell>{o?.Rb}</CCell><CCell>/</CCell>
                            <CCell>{o?.Ra}</CCell><CCell>/</CCell>
                            <CCell>{o?.Er}</CCell>
                            <CCell>/</CCell><CCell>/</CCell>
                        </TableRow>;
                    })}
                    <TableRow>
                        <CCell rowSpan={lijuSpan}>9</CCell>
                        <CCell rowSpan={lijuSpan}>{items观测[8][1]}</CCell>
                        <CCell>(单位为tm)</CCell>
                        <CCell>Mb</CCell><CCell>/</CCell>
                        <CCell>Ma</CCell><CCell>/</CCell>
                        <CCell>E<sub>M</sub></CCell><CCell>/</CCell><CCell>/</CCell>
                        <CCell rowSpan={lijuSpan}>{orc?.[items观测[8][0]+'r']}</CCell>
                    </TableRow>
                    {力矩its.map((rowl, r: number) => {
                        const tabn=items观测[8][0];
                        const o = orc?.[tabn]?.[r];
                        return <TableRow key={r}>
                            <CCell>{rowl}</CCell>
                            <CCell>{3===r? '/' : o?.Mb}</CCell><CCell>/</CCell>
                            <CCell>{3===r? '/' : o?.Ma}</CCell><CCell>/</CCell>
                            <CCell>{o?.Em}</CCell>
                            <CCell>/</CCell><CCell>{3===r? o?.R : '/'}</CCell>
                        </TableRow>;
                    })}
                </RepLink>
            </TableBody>
        </Table>
        {children}
    </>;
};
